import yaml
from typing import List, Dict, Any
from langchain_core.prompts import ChatPromptTemplate
from langchain.agents import Tool, AgentType, initialize_agent
from tools.log_handler import logger
from tools.web_search import WebSearchTool
from config.PathConfig import PROMPTS_CONFIG
from integrations.langchain_client import llm

# 工具注册器
class ToolRegistry:
    def __init__(self):
        self.tools: List[Tool] = []
    
    def register_tool(self, tool: Tool):
        self.tools.append(tool)
        logger.info(f"注册工具: {tool.name}")
    
    def register_tools(self, tools: List[Tool]):
        self.tools.extend(tools)
        logger.info(f"批量注册工具: {[tool.name for tool in tools]}")
    
    def get_tools(self) -> List[Tool]:
        return self.tools